clipmoinet = {};
$(document).ready(function (e) {
	clipmoinet.init();
});
clipmoinet.init = function () {
	clipmoinet.Core.registerMenuNavigation();
	clipmoinet.Core.registerTabClick();
};
clipmoinet.Core = {
	registerMenuNavigation: function () {
		$('ul.menu').find('li').each(function () {
			$(this).hover(function (e) {
				$(this).addClass('activetrai');
				var $sub = $(this).children('ul:eq(0)');
				if (typeof $sub.queue() != 'undefined' && $sub.queue() <= 1) {
					$sub.slideDown(150).addClass('show');
				}
			}, function () {
				$(this).removeClass('activetrai');
				var $sub = $(this).children('ul:eq(0)');
				$sub.slideUp(100).removeClass('show');
			});
		});
	},
	registerTabClick: function () {
		$('.tabstrai .tabtrai').click(function (e) {
			var $tabstrai = $(this).parent();
			var name = $(this).data('name');
			var $target = $($tabstrai.data('target'));
	
			$tabstrai.find('.tabtrai').removeClass('activetrai');
			$(this).addClass('activetrai');
			$target.find('.tabtrai').hide();
			$target.find('.' + name).show();
		});
	}
};

	


numposts = 30; 

String.prototype.GetValue= function(para) {
  var reg = new RegExp("(^|&)"+ para +"=([^&]*)(&|$)");
  var r = this.substr(this.indexOf("\?")+1).match(reg);
  if (r!=null) return unescape(r[2]); return null;
}

var str = location.href;
var page = str.GetValue("page");
var view = str.GetValue("v"); 
var homepageurl = "http://xem.clipmoi.net/";
var urllength = homepageurl.length;

if (page==undefined) { page = "1"; }
if (view==undefined) { view = "full"; }



if (str.indexOf("search/label")!=-1) {
if (str.indexOf("?")!=-1){
var str1 = str.split("?")[0];
var label = str1.substring(urllength+13,str1.length);
}else {
var label = str.substring(urllength+13,str.length);}
var textlabel = "/-/"+label;
var textpage = "search/label/"+label;}
else {var textlabel ="";var textpage = ""; }

function rutgon(f,d){for(var a=f.split("<"),c=0;c<a.length;c++)-1!=a[c].indexOf(">")&&(a[c]=a[c].substring(a[c].indexOf(">")+1,a[c].length));a=a.join("");return a.substring(0,d-1)} function sdr(f){maxpost=numposts<=f.feed.entry.length?numposts:f.feed.entry.length;for(var d=0;d<maxpost;d++){for(var a=f.feed.entry[d],c=a.title.$t,e,b=0;b<a.link.length;b++)if("alternate"==a.link[b].rel){e=a.link[b].href;break}a="content"in a?a.content.$t:"summary"in a?a.summary.$t:"";b=Math.random();xluotxem=Math.round(3E4*b);0==d&&(b='<li><span class="st top">1</span><div class="detail"><div class="name"><a class="vtip" title="'+rutgon(a,350)+'..." href="'+e+'">'+c+'</a></div><div class="views">L\u01b0\u1ee3t xem '+ xluotxem+"</div></div></li>",document.write(b));1==d&&(b='<li><span class="st top">2</span><div class="detail"><div class="name"><a class="vtip" title="'+rutgon(a,350)+'..." href="'+e+'">'+c+'</a></div><div class="views">L\u01b0\u1ee3t xem '+xluotxem+"</div></div></li>",document.write(b));2==d&&(b='<li><span class="st top">3</span><div class="detail"><div class="name"><a class="vtip" title="'+rutgon(a,350)+'..." href="'+e+'">'+c+'</a></div><div class="views">L\u01b0\u1ee3t xem '+xluotxem+"</div></div></li>", document.write(b));3==d&&(b='<li><span class="st">4</span><div class="detail"><div class="name"><a class="vtip" title="'+rutgon(a,350)+'..." href="'+e+'">'+c+'</a></div><div class="views">L\u01b0\u1ee3t xem '+xluotxem+"</div></div></li>",document.write(b));4==d&&(b='<li><span class="st">5</span><div class="detail"><div class="name"><a class="vtip" title="'+rutgon(a,350)+'..." href="'+e+'">'+c+'</a></div><div class="views">L\u01b0\u1ee3t xem '+xluotxem+"</div></div></li>",document.write(b));5==d&& (b='<li><span class="st">6</span><div class="detail"><div class="name"><a class="vtip" title="'+rutgon(a,350)+'..." href="'+e+'">'+c+'</a></div><div class="views">L\u01b0\u1ee3t xem '+xluotxem+"</div></div></li>",document.write(b));6==d&&(b='<li><span class="st">7</span><div class="detail"><div class="name"><a class="vtip" title="'+rutgon(a,350)+'..." href="'+e+'">'+c+'</a></div><div class="views">L\u01b0\u1ee3t xem '+xluotxem+"</div></div></li>",document.write(b));7==d&&(b='<li><span class="st">8</span><div class="detail"><div class="name"><a class="vtip" title="'+ rutgon(a,350)+'..." href="'+e+'">'+c+'</a></div><div class="views">L\u01b0\u1ee3t xem '+xluotxem+"</div></div></li>",document.write(b));8==d&&(b='<li><span class="st">9</span><div class="detail"><div class="name"><a class="vtip" title="'+rutgon(a,350)+'..." href="'+e+'">'+c+'</a></div><div class="views">L\u01b0\u1ee3t xem '+xluotxem+"</div></div></li>",document.write(b));9==d&&(b='<li><span class="st">10</span><div class="detail"><div class="name"><a class="vtip" title="'+rutgon(a,350)+'..." href="'+ e+'">'+c+'</a></div><div class="views">L\u01b0\u1ee3t xem '+xluotxem+"</div></div></li>",document.write(b))}document.write("")};


function topli(d){maxpost=numposts<=d.feed.entry.length?numposts:d.feed.entry.length;for(var c=0;c<maxpost;c++){for(var a=d.feed.entry[c],f=a.title.$t,g,b=0;b<a.link.length;b++)if("alternate"==a.link[b].rel){g=a.link[b].href;break}var h="content"in a?a.content.$t:"summary"in a?a.summary.$t:"",e=[];if(a.category)for(b=0;b<a.category.length;b++)e[b]=" "+a.category[b].term+"";else e="No label";0<=c&&20>=c&&(a='<li><a class="vtip" title="'+f+'" href="'+g+'">'+rutgon(f,35)+"...</a><span><a href='/search/label/"+e[1]+"?&max-results=32'>"+ e[1]+"</span></a></li>",document.write(a))}document.write("")};



<!--hết phần tab bài hat va audio-->